<template>
  <div class="order-list">
    <div class="order-header border-bottom">
      <div class="back-icon" @click="goBack">
        <i class="el-icon-arrow-left">返回</i>
      </div>
      <div class="order-title">
        <p>我的订单</p>
      </div>
    </div>
    <div class="order-body">
      <el-tabs v-model="activeName"
               stretch
               class="order-tabs border-bottom"
               @tab-click="handleClick">
        <el-tab-pane label="全部订单" name="first" class="scroll-bar">
            <div class="pane-item border" v-for="item in orderInfo" :key="item.id">
              <div class="item-title border-bottom">
                <svg class="icon" aria-hidden="true" slot="prefix">
                  <use xlink:href="#icon-gerenqian"></use>
                </svg>
                <span>{{ item.owner }}</span>
              </div>
              <div class="items-content">
                <router-link to="/personal_index">
                  <div class="content-box border-bottom">
                  <div class="content-img">
                    <img :src="item.goods_img" alt="">
                  </div>
                  <div class="content-text">
                    <p class="service-type">{{ item.goods_title }}</p>
                    <p class="remark">{{ item.remark }}</p>
                  </div>
                  <div class="content-detail">
                    <p class="single-price">￥ <span>{{ item.single_price }}</span></p>
                    <p class="account"> x  <span>{{ item.account }}</span></p>
                  </div>
                </div>
                </router-link>
                <div class="summary border-bottom">
                  <p>总计 <span>{{ item.all_num }}</span> 件商品</p>
                  <p>合计: ￥<span>{{ item.all_price }}</span> </p>
                </div>
                <div class="user-action">

                  <el-button type="warning" round>删除订单</el-button>
                  <el-button round>评价</el-button>
                </div>
              </div>
            </div>
        </el-tab-pane>
        <el-tab-pane label="进行中" name="second">
          <div class="pane-item border">
            <div class="item-title border-bottom">
              <svg class="icon" aria-hidden="true" slot="prefix">
                <use xlink:href="#icon-gerenqian"></use>
              </svg>
              <span>我就是狗剩先生啊</span>
            </div>
            <div class="items-content">
              <div class="content-box border-bottom">
                <div class="content-img">
                  <img src="@/assets/styles/image/avatar/avatar1.jpg" alt="">
                </div>
                <div class="content-text">
                  <p class="service-type">快递待领服务快递待领服务快递待领服务</p>
                  <p class="remark">大件</p>
                </div>
                <div class="content-detail">
                  <p class="single-price">￥ <span>2 </span></p>
                  <p class="account"> x  <span>1</span> </p>
                </div>
              </div>
              <div class="summary border-bottom">
                <p>总计 <span>2</span> 件商品</p>
                <p>合计: ￥<span>2</span> </p>
              </div>
              <div class="user-action">

                <el-button type="warning" round>删除订单</el-button>
                <el-button round>评价</el-button>
              </div>
            </div>
          </div>
          <div class="pane-item border">
            <div class="item-title border-bottom">
              <svg class="icon" aria-hidden="true" slot="prefix">
                <use xlink:href="#icon-gerenqian"></use>
              </svg>
              <span>我就是狗剩先生啊</span>
            </div>
            <div class="items-content">
              <div class="content-box border-bottom">
                <div class="content-img">
                  <img src="@/assets/styles/image/avatar/avatar1.jpg" alt="">
                </div>
                <div class="content-text">
                  <p class="service-type">快递待领服务快递待领服务快递待领服务</p>
                  <p class="remark">大件</p>
                </div>
                <div class="content-detail">
                  <p class="single-price">￥ <span>2 </span></p>
                  <p class="account"> x  <span>1</span> </p>
                </div>
              </div>
              <div class="summary border-bottom">
                <p>总计 <span>2</span> 件商品</p>
                <p>合计: ￥<span>2</span> </p>
              </div>
              <div class="user-action">

                <el-button type="warning" round>删除订单</el-button>
                <el-button round>评价</el-button>
              </div>
            </div>
          </div>
          <div class="pane-item border">
            <div class="item-title border-bottom">
              <svg class="icon" aria-hidden="true" slot="prefix">
                <use xlink:href="#icon-gerenqian"></use>
              </svg>
              <span>我就是狗剩先生啊</span>
            </div>
            <div class="items-content">
              <div class="content-box border-bottom">
                <div class="content-img">
                  <img src="@/assets/styles/image/avatar/avatar1.jpg" alt="">
                </div>
                <div class="content-text">
                  <p class="service-type">快递待领服务快递待领服务快递待领服务</p>
                  <p class="remark">大件</p>
                </div>
                <div class="content-detail">
                  <p class="single-price">￥ <span>2 </span></p>
                  <p class="account"> x  <span>1</span> </p>
                </div>
              </div>
              <div class="summary border-bottom">
                <p>总计 <span>2</span> 件商品</p>
                <p>合计: ￥<span>2</span> </p>
              </div>
              <div class="user-action">

                <el-button type="warning" round>删除订单</el-button>
                <el-button round>评价</el-button>
              </div>
            </div>
          </div>
        </el-tab-pane>
        <el-tab-pane label="已完成" name="third">
          <div class="pane-item border">
            <div class="item-title border-bottom">
              <svg class="icon" aria-hidden="true" slot="prefix">
                <use xlink:href="#icon-gerenqian"></use>
              </svg>
              <span>我就是狗剩先生啊</span>
            </div>
            <div class="items-content">
              <div class="content-box border-bottom">
                <div class="content-img">
                  <img src="@/assets/styles/image/avatar/avatar1.jpg" alt="">
                </div>
                <div class="content-text">
                  <p class="service-type">快递待领服务快递待领服务快递待领服务</p>
                  <p class="remark">大件</p>
                </div>
                <div class="content-detail">
                  <p class="single-price">￥ <span>2 </span></p>
                  <p class="account"> x  <span>1</span> </p>
                </div>
              </div>
              <div class="summary border-bottom">
                <p>总计 <span>2</span> 件商品</p>
                <p>合计: ￥<span>2</span> </p>
              </div>
              <div class="user-action">

                <el-button type="warning" round>删除订单</el-button>
                <el-button round>评价</el-button>
              </div>
            </div>
          </div>
          <div class="pane-item border">
            <div class="item-title border-bottom">
              <svg class="icon" aria-hidden="true" slot="prefix">
                <use xlink:href="#icon-gerenqian"></use>
              </svg>
              <span>我就是狗剩先生啊</span>
            </div>
            <div class="items-content">
              <div class="content-box border-bottom">
                <div class="content-img">
                  <img src="@/assets/styles/image/avatar/avatar1.jpg" alt="">
                </div>
                <div class="content-text">
                  <p class="service-type">快递待领服务快递待领服务快递待领服务</p>
                  <p class="remark">大件</p>
                </div>
                <div class="content-detail">
                  <p class="single-price">￥ <span>2 </span></p>
                  <p class="account"> x  <span>1</span> </p>
                </div>
              </div>
              <div class="summary border-bottom">
                <p>总计 <span>2</span> 件商品</p>
                <p>合计: ￥<span>2</span> </p>
              </div>
              <div class="user-action">

                <el-button type="warning" round>删除订单</el-button>
                <el-button round>评价</el-button>
              </div>
            </div>
          </div>
        </el-tab-pane>
        <el-tab-pane label="待评价" name="fourth">
          <div class="pane-item border">
            <div class="item-title border-bottom">
              <svg class="icon" aria-hidden="true" slot="prefix">
                <use xlink:href="#icon-gerenqian"></use>
              </svg>
              <span>我就是狗剩先生啊</span>
            </div>
            <div class="items-content">
              <div class="content-box border-bottom">
                <div class="content-img">
                  <img src="@/assets/styles/image/avatar/avatar1.jpg" alt="">
                </div>
                <div class="content-text">
                  <p class="service-type">快递待领服务快递待领服务快递待领服务</p>
                  <p class="remark">大件</p>
                </div>
                <div class="content-detail">
                  <p class="single-price">￥ <span>2 </span></p>
                  <p class="account"> x  <span>1</span> </p>
                </div>
              </div>
              <div class="summary border-bottom">
                <p>总计 <span>2</span> 件商品</p>
                <p>合计: ￥<span>2</span> </p>
              </div>
              <div class="user-action">

                <el-button type="warning" round>删除订单</el-button>
                <el-button round>评价</el-button>
              </div>
            </div>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
  import BScroll from 'better-scroll'
  export default {
    name: "OrderList",
    data () {
      return {
        activeName: 'first',
        orderInfo: [
          {
            id: '001',
            owner: '我就是狗剩先生啊',
            goods_img: 'http:static/img/avatar1.694b2eb.jpg',
            goods_title: '快递代领服务',
            remark: '大件',
            single_price: '2',
            account: '1',
            all_num: '1',
            all_price: '2'
          },
          {
            id: '002',
            owner: '我就是狗剩先生啊',
            goods_img: 'http:static/img/avatar1.694b2eb.jpg',
            goods_title: '快递代领服务',
            remark: '大件',
            single_price: '2',
            account: '1',
            all_num: '1',
            all_price: '2'
          },
          {
            id: '003',
            owner: '我就是狗剩先生啊',
            goods_img: 'http:static/img/avatar1.694b2eb.jpg',
            goods_title: '快递代领服务',
            remark: '大件',
            single_price: '2',
            account: '1',
            all_num: '1',
            all_price: '2'
          },
          {
            id: '004',
            owner: '我就是狗剩先生啊',
            goods_img: 'http:static/img/avatar1.694b2eb.jpg',
            goods_title: '快递代领服务',
            remark: '大件',
            single_price: '2',
            account: '1',
            all_num: '1',
            all_price: '2'
          }
        ],
      }
    },
    methods: {
      goBack () {
        this.$router.push('/personal_index');
      },
      handleClick() {
        console.log(111);
      }
    },

  }
</script>

<style scoped>

  /* 通用 */
  a {
    text-decoration: none;
    color: unset;
  }
  /* header */
  .order-header {
    width: 100%;
    height: 50px;
    background: #fff;
  }
  .order-title,.back-icon {
    float: left;
    color: #666;
    text-align: center;
  }
  .back-icon {
    width: 20%;
    line-height: 50px;
    font-size: 16px;
    z-index: 2;
    color: #1989fa;
  }
  .order-title {
    width: 80%;
    line-height: 50px;
    font-size: 18px;
  }
  .order-title p {
    margin: 0 20% 0 0;
  }
  /* 选项卡 */
  .order-tabs {
    padding: 0 .8rem 15px;
  }
  /* 订单 */
  .pane-item {
    padding: 0 5px;
    margin-bottom: 15px;
  }
  .pane-item:before {
    border-radius: 10px;
  }
  .pane-item p {
    margin: 0;
  }
  .content-box {
    display: flex;
    padding: .3rem 0;
  }
  .item-title {
    padding: 10px 0;
    font-size: 14px;
  }
  .item-title .icon {
    font-size: 18px;
  }
  .item-title span {
    font-size: 14px;
    color: #333;
    font-weight: 500;
  }
  .content-img {
    width: 20%;
    margin: 0 .1rem;
  }
  .content-img img {
    width: 100%;
  }
  .content-text {
    flex: 5;
    padding: 0 .1rem;
    overflow: hidden;
  }
  .content-text p.remark {
    font-size: 12px;
    color: #999;
    margin: .5rem .3rem;
  }
  .content-text p.service-type {
    font-size: 14px;
    margin: .5rem .3rem;
    color: #666;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .content-detail {
    text-align: right;
    color: #666;
    margin: .5rem .5rem 0;
    flex: 2;
  }
  .content-detail .single-price {
    margin-bottom: 1rem;
    color: #f04141;
  }
  .summary {
    display: flex;
    padding: .5rem 0;
  }
  .summary p:first-child{
    flex: 1;
    text-align: center;
    font-size: 14px;
    color: #666;
    padding-left: 3rem;
  }
  .summary p:last-child {
    flex: 1;
    text-align: right;
    padding-right: .5rem;
    font-size: 14px;
    color: #666;
  }
  .summary p span{
    font-weight: 500;
    color: #000;
    font-size: 15px;
  }
  .summary p:first-child span {
    padding: 0 .2rem;
  }
  .summary p:last-child span {
    padding-left: .2rem;
  }
  .user-action{
    text-align: right;
    padding: 10px .5rem;
  }
  .el-button.is-round {
    border-radius: 20px;
    padding: 5px 11px;
    font-size: 12px;
  }
</style>
